package org.datastealer.config;

import org.datastealer.properties.DataStealerProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;

/**
 * Note：当web应用时候启动当前服务，扫描org.datastealer路径(但是排除dao)，启用DataStealerProperties配置，导入Bean的配置和和Tomcat的配置
 *
 * @author ：mengjw
 * @description：DataStealer自动配置类
 * @date ：Created in 2020/8/24
 */
@Configuration
@ConditionalOnWebApplication
@ConditionalOnProperty("datastealer.enable")
@EnableConfigurationProperties({DataStealerProperties.class})
@Import({DataStealerBeanConfiguration.class})
@ComponentScan(value = "org.datastealer",
        excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*dao.*"))
public class DataStealerAutoConfigure {

}